#include<stdio.h>

int main() {
    int a, b, c, d;
    scanf("%d", &a);
    if (a >= 24 * 3600) {
        a = a - (a / (24 * 3600)) * 24 * 3600;
    }
    b = a / 3600;
    c = (a - b * 3600) / 60;
    d = a - b * 3600 - c * 60;
    printf("%02d:%02d:%02d", b, c, d);
    return 0;

}
